#
# Run experiments for diploma thesis (new, DPM kernels).
#

use strict;
use warnings;

my $home = 'C:\Users\ungerma\Desktop\DA\dual-process-model\dpm';
my @folders = ('gen\results\qq', 'gen\results\qq', );
my %result;
my $n = 0;
my $limit = 90;


foreach my $folder (@folders) {

	opendir D, "$folder" or die "Could not open dir: $!\n";
	my @files = grep(/pr-\d+/i, readdir D);
	foreach my $file (@files) {
		next unless $file =~ /pr-(\d+)-\d+-(\d+)-(\d+)-(\d+)/;
		my ($g, $lhs, $rhs, $prec,) = ($2, $3, $4, $1);
		if ($prec >= $limit) {
			$result{$g}++;
			++$n;
			if($g == 0) {
				print "***$file***\n";
			}
		}
	}
	closedir D;

}

foreach my $key (keys %result) {
	
	print "$key " . $result{$key}/$n . "\n";

}
